﻿
Partial Class Estado_ubicaciones
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim usuario = Membership.GetUser()
    End Sub

    
    Protected Sub btnMover_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnMover.Click
        Dim sConcatena As String
        sConcatena = ""
        Dim item As DataListItem
        For Each item In dlAnimales.Items ' Primero recorro cada elemento del datalist
            Dim mygrid As GridView = item.FindControl("gvCorral") ' ubico my griview
            For Each row In mygrid.Rows ' Recorro el grid
                Dim chk As CheckBox = row.FindControl("chkItemSelect")
                If chk IsNot Nothing AndAlso chk.Checked Then 'Si está seleccionado obten el id del Animal
                    sConcatena &= mygrid.DataKeys(row.RowIndex).Value & ","
                End If
            Next
            mygrid = Nothing
        Next
        sConcatena = sConcatena.Remove(sConcatena.Length - 1, 1)
        lblRespuesta.Text = sConcatena

    End Sub
End Class
